package pl.edu.pw.stud.ltrzaska.logic;

import org.apache.commons.vfs.FileObject;

import pl.edu.pw.stud.ltrzaska.policy.entity.FilesystemObject;

/**
 * Reprezentuje niezgodnosc w systemie plikow. Przechowuje niezbedne informacje
 * do utworzenia raportu oraz wykonania reakcji na blad.
 * 
 * @author luk
 * 
 */
public class PolicyViolation {

	/**
	 * Konstruktor minimalny.
	 * 
	 * @param name
	 * @param shortDescription
	 * @param policyFileObject
	 * @param virtualFileObject
	 */
	public PolicyViolation(Class validator, String name, String shortDescription, FilesystemObject policyFileObject, FileObject virtualFileObject) {
		super();
		this.setValidatorClazz(validator);
		this.name = name;
		this.shortDescription = shortDescription;
		this.policyFileObject = policyFileObject;
		this.virtualFileObject = virtualFileObject;
	}

	/**
	 * Konnstruktor z pelna informacja o niezgodnosci.
	 * 
	 * @param name
	 * @param shortDescription
	 * @param detailedDescription
	 * @param policyFileObject
	 * @param virtualFileObject
	 */
	public PolicyViolation(Class validator, String name, String shortDescription, String detailedDescription, FilesystemObject policyFileObject, FileObject virtualFileObject) {
		super();

		this.validatorClazz = validator;
		this.name = name;
		this.shortDescription = shortDescription;
		this.detailedDescription = detailedDescription;
		this.policyFileObject = policyFileObject;
		this.virtualFileObject = virtualFileObject;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public String getDetailedDescription() {
		return detailedDescription;
	}

	public void setDetailedDescription(String detailedDescription) {
		this.detailedDescription = detailedDescription;
	}

	public FilesystemObject getPolicyFileObject() {
		return policyFileObject;
	}

	public void setPolicyFileObject(FilesystemObject policyFileObject) {
		this.policyFileObject = policyFileObject;
	}

	public FileObject getVirtualFileObject() {
		return virtualFileObject;
	}

	public void setVirtualFileObject(FileObject virtualFileObject) {
		this.virtualFileObject = virtualFileObject;
	}

	public void setValidatorClazz(Class validatorClazz) {
		this.validatorClazz = validatorClazz;
	}

	public Class getValidatorClazz() {
		return validatorClazz;
	}

	private Class validatorClazz;
	private String name;
	private String shortDescription;
	private String detailedDescription;
	private FilesystemObject policyFileObject;
	private FileObject virtualFileObject;
}
